/*

Summary:
TextBox class.

Remark:
None.

Version:
0.0.2

LastUpdatedDate:
2012-09-21

*/

#pragma once


#include "ControlWindow.h"
#include "TextAlign.h"



namespace Zaf {
namespace Mwl {
namespace __Internal {
	class DefaultPwdCharPicker;
	class WndProcPicker;
}

class TextBox : public ControlWindow {

public:
	TextBox();
	explicit TextBox(WORD id);
	virtual ~TextBox();

	bool IsReadOnly() const;
	void IsReadOnly(bool value);

	bool IsMultiLine() const;
	void IsMultiLine(bool value);

	bool IsNumberOnly() const;
	void IsNumberOnly(bool value);

	bool IsPassword() const;
	void IsPassword(bool value);

	bool IsLowercase() const;
	void IsLowercase(bool value);

	bool IsUppercase() const;
	void IsUppercase(bool value);

	bool IsAutoHorizontalScroll() const;
	void IsAutoHorizontalScroll(bool value);

	bool IsAutoVerticalScroll() const;
	void IsAutoVerticalScroll(bool value);

	bool NoHideSelection() const;
	void NoHideSelection(bool value); 

	TextAlign GetTextAlign() const;
	void SetTextAlign(TextAlign value);

	bool AcceptReturn() const;
	void AcceptReturn(bool value);

	bool AcceptTab() const;
	void AcceptTab(bool value);

protected:
	LRESULT WndProc(const WndMsg& msg);
	LRESULT DefWndProc(const WndMsg& msg);

private:
	void CommonContructor();
	HWND CreateConcreteWindow();

	static const wchar_t* const ClassName;
	static __Internal::WndProcPicker TextBoxWndProc;
	static __Internal::DefaultPwdCharPicker DefPwdCharPicker;

	bool m_acceptTab;
};

}
}